<!--#include file="conn.asp"-->
<!--#include file="chkuser.asp"-->
<%
call adminRight(1)

if request("Action")="doShow" then
	ArticleID=request("ArticleID")
	if ArticleID="" then
		alert("请选择文章！")
		goback()
		response.End()
	end if
    arrArticleID=split(ArticleID,",")
    for tj_i=0 to ubound(arrArticleID)
		set rstj=Server.CreateObject("ADODB.Recordset")
		sqltj="select * from Product where ID="&clng(arrArticleID(tj_i))
		rstj.open sqltj,conn,1,3
		if rstj("Show")=False then
			rstj("Show")=True
		else
			rstj("Show")=False
		end if
		rstj.update
		rstj.close
		set rstj=nothing
    next
	go("?curpage="&request("curpage")&"")
end if
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>业务管理</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="popUpWin.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript" src="popupdiv.js"></script>
<script language="javascript" type="text/javascript">
function selcheck(id) {
   var e =document.getElementById(id);
   var objs = e.getElementsByTagName("input");
   if (e.checked){
      e.checked = false;
      for(var i=0; i<objs.length; i++) {
         if(objs[i].type.toLowerCase() == "checkbox" )
         objs[i].checked = false;
      }
   }   else   {
      e.checked = true;
      for(var i=0; i<objs.length; i++) {
         if(objs[i].type.toLowerCase() == "checkbox" )
         objs[i].checked = true;
      }
   }
}
</script>
</head>
<body>
<div id="frame_Toolbar" class="toolbarBg"> 
		<a href="javascript:self.history.back();" class="icoBtn_ct"><span class="btnIco btnBack"></span>返回</a> 
		<a href="javascript:self.location.reload();" class="icoBtn_ct"><span class="btnIco btnReload"></span>刷新</a> 
		<span class="split ftSplit" ></span>
	    <div id="guide">
				点击<span class="light_orange"> 业务标题 </span>进行编辑
				<%if ProductClassSD_con>0 then%><!--#include file="Admin_Product_Select.asp"--><%end if%>
	    </div>
        <div id="search">
		<form name="search" action="?" method="post">
		搜索：<input name="key" type="text" size="20">
		<input name="search" type="submit" value="搜索" class="searchBtn">
		</form>
	    </div>
		<%	  
			key = trim(request("key"))
			oneclassid = trim(request("oneclassid"))
			twoclassid = trim(request("twoclassid"))
			threeclassid = trim(request("threeclassid"))
			fourclassid = trim(request("fourclassid"))
			fiveclassid = trim(request("fiveclassid"))
			   Set rs = Server.CreateObject("ADODB.Recordset")
			   sql="select * from Product where id>0 "
			   if oneclassid<>"" then sql=sql&"and OneClassID="&oneclassid&" "
			   if twoclassid<>"" then sql=sql&"and TwoClassID="&twoclassid&" "
			   if threeclassid<>"" then sql=sql&"and ThreeClassID="&threeclassid&" "
			   if fourclassid<>"" then sql=sql&"and FourClassID="&fourclassid&" "
			   if fiveclassid<>"" then sql=sql&"and FiveClassID="&fiveclassid&" "
			   if key<>"" then sql=sql&"and title like '%"&key&"%' "
			   sql=sql&" order by "&ProductPXMethod_con&" "
			   rs.open sql,conn,1,1
	    %>
	    <div class="pageInfo right light_gray">[当前共有<span id="Label_total_top" class="light_bOrange"><%=rs.recordcount%></span>条记录]</div>
</div>

	<form method="POST" id=form2 name="form2" action="">
	<div id="MainContent">
     <table class="cTable table tCenter">
	    <tr class="cTitle toolbarBg" id="Title">
		    <td width="5%"><span class="checkbox">
	      <input type="checkbox" name="chkall" onClick="selcheck('MainContent')" /></span></td>
		    <td width="9%"><span class="split ctSplit"></span>
	      <div>编号<%
			if instr(ProductPXMethod_con,"id")>0 then
			 if instr(ProductPXMethod_con,"id asc")>0 then
			   response.Write("<sup style='font-size:9px;color:#FF0000'>↑</sup>") 
			 else
			   response.Write("<sup style='font-size:9px;color:#FF0000'>↓</sup>") 
			 end if
			end if
			%></div></td>
		    <td width="29%"><span class="split ctSplit"></span>
	      <div>业务标题</div></td>
		    <%if instr(ProductPXMethod_con,"px")>0 then%>
		    <td width="13%"><span class="split ctSplit"></span>
	      <div>排序<%
			 if instr(ProductPXMethod_con,"px asc")>0 then
			   response.Write("<sup style='font-size:9px;color:#FF0000'>↑</sup>") 
			 else
			   response.Write("<sup style='font-size:9px;color:#FF0000'>↓</sup>") 
			 end if
			%></div></td>
			<%end if%>
		    <td width="11%"><span class="split ctSplit"></span>
	      <div>点击次数</div></td>
		    <td width="12%"><span class="split ctSplit"></span>
	      <div>发布日期<%
			if instr(ProductPXMethod_con,"adddate")>0 then
			 if instr(ProductPXMethod_con,"adddate asc")>0 then
			   response.Write("<sup style='font-size:9px;color:#FF0000'>↑</sup>") 
			 else
			   response.Write("<sup style='font-size:9px;color:#FF0000'>↓</sup>") 
			 end if
			end if
			%></div></td>
			<td width="11%"><span class="split ctSplit"></span>
		  <div>是否推荐</div></td>
			<td width="10%"><span class="split ctSplit"></span>
		  <div>编辑</div></td>
	    </tr>
	    <%
		rs.pagesize=14
		curpage=clng(request("curpage"))
		if curpage<=0 then curpage=1 
		if curpage > rs.pagecount then curpage=rs.pagecount
		if not rs.eof then rs.absolutepage=curpage
		for i=1 to rs.pagesize
		if rs.eof then exit for
		str=rs("Title")
		%>
		<tr class="trDataList" onMouseOver="this.className='trDataListHover'" onMouseOut="this.className='trDataList'">
			<td><input type="checkbox" name="ArticleID" value="<%=rs("ID")%>" /></td>
			<td><%=rs("ID")%></td>
			<td><a href="Admin_Product_Edit.asp?ArticleID=<%=rs("ID")%>" title="<%=str%>"><%=gotTopic(str,33)%></a>
			</td>
		    <%if instr(ProductPXMethod_con,"px")>0 then%>
			<td><iframe name="px" style="width:90px; height:25px" scrolling="no" frameborder="0" align="middle" src="Admin_Product_px.asp?id=<%=rs("id")%>"></iframe></td>
			<%end if%>
			<td><%=rs("Hits")%></td>
			<td><%=rs("AddDate")%></td>
			<td><%
			    if rs("Show")=true then
				response.Write("<font color=red>已推荐</font>")
				else
				response.Write("未推荐")
				end if
				%></td>
			<td><a href="Admin_Product_Edit.asp?ArticleID=<%=rs("ID")%>">编辑</a>/<a href="Admin_Product_Del.asp?ArticleID=<%=rs("ID")%>&Action=Del" onClick="return confirm('确定删除？')">删除</a></td>
		</tr>
		<%
		rs.movenext
		next
        %>	
	</table> 
    <div id="cEndToolbar" class="toolbarBg">
        <div class="pageList">
				<%
				qryString=""
				if oneclassid<>"" then qryString=qryString&"&oneclassid="&oneclassid
				if twoclassid <> "" then qryString=qryString&"&twoclassid="&twoclassid
				if threeclassid <> "" then qryString=qryString&"&threeclassid="&threeclassid
				if fourclassid <> "" then qryString=qryString&"&fourclassid="&fourclassid
				if fiveclassid <> "" then qryString=qryString&"&fiveclassid="&fiveclassid
				if key<>"" then qryString=qryString&"&key="&key
				set pageObj=new pager
				response.Write pageObj.link(rs.recordcount,rs.pagesize,curpage,"?curpage=",qryString)
				%>
		 <%
			rs.close
			Set rs=nothing
		 %>
	    </div>
	    <div class="pageSelect"><span class="iptSl"><input type="checkbox" name="chkall" onClick="selcheck('MainContent')" /></span><a href="javascript:selcheck('MainContent');"><span class="btnTxt">选择</span></a></div>
	    <span class="split cpSplit" ></span>
	    <div class="pageBtnDo">
	        <div class="icoBtn_do"><input type="image" name="Delete_Button" id="Delete_Button" class="btnIco btnDel" src="images/Empty.gif" onClick="document.form2.action='Admin_Product_Del.asp?Action=Del';return confirm('确定要删除吗?');" style="border-width:0px;" /><input type="image" src="images/Empty.gif" name="Recommend_Button" id="Recommend_Button" class="btnIco Recommend_Button" onClick="document.form2.action='?Action=doShow&curpage=<%=curpage%>';return confirm('确定批量推荐和反推荐?\n------------------------- \nNotice：原推荐的则变为不推荐，原不推荐的则变为推荐！');" /></div>
	    </div>
	</div>	
    </div>
	</form>
</body>
</html>